package com.xpffly.design.proxy.force.service.impl;

import com.xpffly.design.proxy.force.service.GamePlayer;

/**
 * @Author: xpengfei
 * @Date: 2021/3/30 22:02
 * @Description：强制代理的代理类
 */
public class GamePlayerProxy implements GamePlayer {

    private GamePlayer gamePlayer = null;

    /**
     * 构造函数传递用户名
     *
     * @param gamePlayer
     */
    public GamePlayerProxy(GamePlayer gamePlayer) {
        this.gamePlayer = gamePlayer;
    }

    public void login(String user, String password) {
        this.gamePlayer.login(user, password);
    }

    public void killBoss() {
        this.gamePlayer.killBoss();
    }

    public void upgrade() {
        this.gamePlayer.upgrade();
    }

    /**
     * 获取代理本身
     *
     * @return
     */
    public GamePlayer getGamePlayerProxy() {
        return this;
    }
}
